<template>
  <view class="container">

    <!-- 消息列表 -->
    <scroll-view class="message-list" scroll-y>
      <!-- 消息项模板 -->
      <view class="message-item" v-for="(item,index) in list" :key="index">
        <image class="avatar" :src="item.avatar"></image>
        
        <view class="content">
          <!-- 用户信息行 -->
          <view class="user-line">
            <text class="username">{{item.username}}</text>
            <text class="action-type">{{item.action}}</text>
            <text class="time">{{item.time}}</text>
          </view>
          
          <!-- 附加内容 -->
          <text class="comment" v-if="item.comment">{{item.comment}}</text>
          
          <!-- 操作按钮 -->
          <text class="thank-btn" v-if="item.showButton">私信感谢</text>
        </view>
      </view>
    </scroll-view>
  </view>
</template>

<style>
.container {
  background: #f5f5f5;
  min-height: 100vh;
}

/* 标题区 */
.header {
  padding: 24rpx;
  background: #ffffff;
  border-bottom: 1rpx solid #eeeeee;
}

.title {
  font-size: 36rpx;
  font-weight: 500;
  color: #333;
}

/* 消息列表 */
.message-list {
  padding: 20rpx 0;
}

.message-item {
  display: flex;
  padding: 24rpx;
  margin: 0 24rpx 24rpx;
  background: #ffffff;
  border-radius: 16rpx;
  box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.04);
}

.avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  margin-right: 24rpx;
}

.content {
  flex: 1;
}

/* 用户信息行 */
.user-line {
  display: flex;
  align-items: baseline;
  margin-bottom: 12rpx;
}

.username {
  font-size: 30rpx;
  color: #333;
  margin-right: 16rpx;
}

.action-type {
  font-size: 26rpx;
  color: #666;
  margin-right: 24rpx;
}

.time {
  font-size: 24rpx;
  color: #999;
}

/* 附加内容 */
.comment {
  display: block;
  font-size: 28rpx;
  color: #333;
  margin: 16rpx 0;
  padding: 16rpx;
  background: #f8f8f8;
  border-radius: 8rpx;
}

/* 私信按钮 */
.thank-btn {
  display: inline-block;
  padding: 8rpx 24rpx;
  border: 1rpx solid #007AFF;
  color: #007AFF;
  border-radius: 40rpx;
  font-size: 24rpx;
  margin-top: 16rpx;
}
</style>

<script>
export default {
  data() {
    return {
      list: [
        {
          avatar: '/static/sample1.jpg',
          username: '一只胖头鱼',
          action: '赞了你的笔记',
          time: '11-11',
          showButton: true
        },
        {
          avatar: '/static/sample1.jpg',
          username: '腾讯视频',
          action: '赞了你的评论',
          time: '10-09',
          comment: '立个flag，明年考试过过'
        },
        {
          avatar: '/static/sample1.jpg',
          username: '杀马特90回忆',
          action: '赞了你的笔记',
          time: '11-06',
          showButton: true
        },
        {
          avatar: '/static/sample1.jpg',
          username: '八六七八',
          action: '赞了你的评论',
          time: '10-08',
          comment: '礼貌'
        }
      ]
    }
  }
}
</script>